main(i,g){char c[80],u,b[9];for(;gets(c);puts("")){if(!strcmp(c,"#"))break;for(i=0;c[i];i++){u=c[i];g=0;if(u==' ')g=strcpy(b,"%%20");if(u=='!')g=strcpy(b,"%%21");if(u=='$')g=strcpy(b,"%%24");if(u=='%')g=strcpy(b,"%%25");if(u=='(')g=strcpy(b,"%%28");if(u==')')g=strcpy(b,"%%29");if(u=='*')g=strcpy(b,"%%2a");g?printf(b):putchar(u);}}}
